package com.example.gaoyang.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 显示屏显示信息
 *
 * @author zhaoxh
 */

@Getter
@AllArgsConstructor
public enum LedInfoEnum {


    IDLE_STATE(1, "减速慢行"),
    PERMITTED_TO_PASS(2, "内部车辆允许通行"),
    NOT_FOLLOWING_THE_RULES(3, "未按规则通行"),
    NON_BRIDGE_AREA_VEHICLES(4, "非桥区车辆禁止通行"),
    NOT_FOLLOWING_THE_RULE_TIME(5, "车辆信息已到期"),
    ;


    private Integer code;

    private String desc;

    public static LedInfoEnum getLedInfoEnumByValue(Integer code) {
        return Arrays.stream(LedInfoEnum.values()).filter(s -> s.code.equals(code)).findFirst().orElse(null);
    }
}
